<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>10.2 Integration Testing 2.2.1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
    <link rel="stylesheet" href="../css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
    <script type="text/javascript">
function addJsClass() {
    var classes = document.body.className.split(" ");
    classes.push("js");
    document.body.className = classes.join(" ");
}
    </script>
</head>

<body class="body" onload="addJsClass();">
<div id="navigation">
    <ul>
        <li>
            <div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
                <a href="../../guide/index.html" class="button">Table of contents</a>

                <div id="nav-summary-childs" style="display:none;">
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/introduction.html"><strong>1</strong><span>Introduction</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/gettingStarted.html"><strong>2</strong><span>Getting Started</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/upgradingFromPreviousVersionsOfGrails.html"><strong>3</strong><span>Upgrading from previous versions of Grails</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/conf.html"><strong>4</strong><span>Configuration</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/commandLine.html"><strong>5</strong><span>The Command Line</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/GORM.html"><strong>6</strong><span>Object Relational Mapping (GORM)</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/theWebLayer.html"><strong>7</strong><span>The Web Layer</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/validation.html"><strong>8</strong><span>Validation</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/services.html"><strong>9</strong><span>The Service Layer</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/testing.html"><strong>10</strong><span>Testing</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/i18n.html"><strong>11</strong><span>Internationalization</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/security.html"><strong>12</strong><span>Security</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/plugins.html"><strong>13</strong><span>Plugins</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/webServices.html"><strong>14</strong><span>Web Services</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/spring.html"><strong>15</strong><span>Grails and Spring</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/hibernate.html"><strong>16</strong><span>Grails and Hibernate</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/scaffolding.html"><strong>17</strong><span>Scaffolding</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/deployment.html"><strong>18</strong><span>Deployment</span></a>
                    </div>
                    
                    <div class="toc-item" style="margin-left:0"><a href="../../guide/contributing.html"><strong>19</strong><span>Contributing to Grails</span></a>
                    </div>
                    
                </div>
            </div>
        </li>
        <li class="separator selected">
            <a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
        </li>
    </ul>
</div>
<div id="header">
    <div class="images clearfix">
        
        <span id="logo"><a href="http://grails.org" target="_blank"><img alt="Grails Logo" title="The Grails Framework" src="../../img/grails.png" border="0"/></a></span>
        
        
        <span id="sponsor"><a href="http://springsource.com" target="_blank"><img alt="SpringSource Logo" title="SpringSource - Weapons for the War on Java Complexity" src="../../img/springsource-logo.png" border="0"/></a></span>
        
    </div>
    <p>See the light - agile, industrial strength, rapid web application development made easy</p>
</div>


<table id="colset" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td id="col1">
            <div id="main" class="corner-all">

                
                    <div class="toc-item prev-left"><a href="../../guide/services.html">&lt;&lt; <strong>9</strong><span>The Service Layer</span></a></div>
                

                <span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>

                
                    <div class="toc-item next-right"><a href="../../guide/i18n.html"><strong>11</strong><span>Internationalization</span> >></a></div>
                


                <div class="project">
                    <h1>10.2 Integration Testing - Reference Documentation</h1>

                    <p><strong>Authors:</strong> Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith</p>

                    <p><strong>Version:</strong> 2.2.1</p>

                    
                </div>

                

                
<a name="9.2 Integration Testing"><!-- Legacy link --></a>
<h2 id="integrationTesting">10.2 Integration Testing</h2>
Integration tests differ from unit tests in that you have full access to the Grails environment within the test. Grails uses an in-memory H2 database for integration tests and clears out all the data from the database between tests.<p class="paragraph"/>One thing to bear in mind is that logging is enabled for your application classes, but it is different from logging in tests. So if you have something like this:<p class="paragraph"/><div class="code"><pre>class MyServiceTests <span class="java&#45;keyword">extends</span> GroovyTestCase &#123;
    void testSomething() &#123;
        log.info <span class="java&#45;quote">"Starting tests"</span>
        &#8230;
    &#125;
&#125;</pre></div><p class="paragraph"/>the "starting tests" message is logged using a different system than the one used by the application. The <code>log</code> property in the example above is an instance of <code>java.util.logging.Logger</code> (inherited from the base class, not injected by Grails), which doesn't have the same methods as the <code>log</code> property injected into your application artifacts. For example, it doesn't have <code>debug()</code> or <code>trace()</code> methods, and the equivalent of <code>warn()</code> is in fact <code>warning()</code>.<p class="paragraph"/><h4>Transactions</h4><p class="paragraph"/>Integration tests run inside a database transaction by default, which is rolled back at the end of the each test. This means that data saved during a test is not persisted to the database. Add a <code>transactional</code> property to your test class to check transactional behaviour:<p class="paragraph"/><div class="code"><pre>class MyServiceTests <span class="java&#45;keyword">extends</span> GroovyTestCase &#123;
    <span class="java&#45;keyword">static</span> transactional = <span class="java&#45;keyword">false</span><p class="paragraph"/>    void testMyTransactionalServiceMethod() &#123;
        &#8230;
    &#125;
&#125;</pre></div><p class="paragraph"/>Be sure to remove any persisted data from a non-transactional test, for example in the <code>tearDown</code> method, so these tests don't interfere with standard transactional tests that expect a clean database.<p class="paragraph"/><h4>Testing Controllers</h4><p class="paragraph"/>To test controllers you first have to understand the Spring Mock Library.<p class="paragraph"/>Grails automatically configures each test with a <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/mock/web/MockHttpServletRequest.html" class="api">MockHttpServletRequest</a>, <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/mock/web/MockHttpServletResponse.html" class="api">MockHttpServletResponse</a>, and <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/mock/web/MockHttpSession.html" class="api">MockHttpSession</a> that you can use in your tests. For example consider the following controller:<p class="paragraph"/><div class="code"><pre>class FooController &#123;<p class="paragraph"/>    def text() &#123;
        render <span class="java&#45;quote">"bar"</span>
    &#125;<p class="paragraph"/>    def someRedirect() &#123;
        redirect(action:<span class="java&#45;quote">"bar"</span>)
    &#125;
&#125;</pre></div><p class="paragraph"/>The tests for this would be:<p class="paragraph"/><div class="code"><pre>class FooControllerTests <span class="java&#45;keyword">extends</span> GroovyTestCase &#123;<p class="paragraph"/>    void testText() &#123;
        def fc = <span class="java&#45;keyword">new</span> FooController()
        fc.text()
        assertEquals <span class="java&#45;quote">"bar"</span>, fc.response.contentAsString
    &#125;<p class="paragraph"/>    void testSomeRedirect() &#123;
        def fc = <span class="java&#45;keyword">new</span> FooController()
        fc.someRedirect()
        assertEquals <span class="java&#45;quote">"/foo/bar"</span>, fc.response.redirectedUrl
    &#125;
&#125;</pre></div><p class="paragraph"/>In the above case <code>response</code> is an instance of <code>MockHttpServletResponse</code> which we can use to obtain the generated content with <code>contentAsString</code> (when writing to the response) or the redirected URL. These mocked versions of the Servlet API are completely mutable (unlike the real versions) and hence you can set properties on the request such as the <code>contextPath</code> and so on.<p class="paragraph"/>Grails <strong class="bold">does not</strong> invoke <a href="../guide/single.html#interceptors" class="guide">interceptors</a> or servlet filters when calling actions during integration testing. You should test interceptors and filters in isolation, using <a href="../guide/single.html#functionalTesting" class="guide">functional testing</a> if necessary.<p class="paragraph"/><h4>Testing Controllers with Services</h4><p class="paragraph"/>If your controller references a service (or other Spring beans), you have to explicitly initialise the service from your test.<p class="paragraph"/>Given a controller using a service:<p class="paragraph"/><div class="code"><pre>class FilmStarsController &#123;
    def popularityService<p class="paragraph"/>    def update() &#123;
        // <span class="java&#45;keyword">do</span> something with popularityService
    &#125;
&#125;</pre></div><p class="paragraph"/>The test for this would be:<p class="paragraph"/><div class="code"><pre>class FilmStarsTests <span class="java&#45;keyword">extends</span> GroovyTestCase &#123;
    def popularityService<p class="paragraph"/>    void testInjectedServiceInController () &#123;
        def fsc = <span class="java&#45;keyword">new</span> FilmStarsController()
        fsc.popularityService = popularityService
        fsc.update()
    &#125;
&#125;</pre></div><p class="paragraph"/><h4>Testing Controller Command Objects</h4><p class="paragraph"/>With command objects you just supply parameters to the request and it will automatically do the command object work for you when you call your action with no parameters:<p class="paragraph"/>Given a controller using a command object:<p class="paragraph"/><div class="code"><pre>class AuthenticationController &#123;
    def signup(SignupForm form) &#123;
        &#8230;
    &#125;
&#125;</pre></div><p class="paragraph"/>You can then test it like this:<p class="paragraph"/><div class="code"><pre>def controller = <span class="java&#45;keyword">new</span> AuthenticationController()
controller.params.login = <span class="java&#45;quote">"marcpalmer"</span>
controller.params.password = <span class="java&#45;quote">"secret"</span>
controller.params.passwordConfirm = <span class="java&#45;quote">"secret"</span>
controller.signup()</pre></div><p class="paragraph"/>Grails auto-magically sees your call to <code>signup()</code> as a call to the action and populates the command object from the mocked request parameters. During controller testing, the <code>params</code> are mutable with a mocked request supplied by Grails.<p class="paragraph"/><h4>Testing Controllers and the render Method</h4><p class="paragraph"/>The <a href="../ref/Controllers/render.html" class="controllers">render</a> method lets you render a custom view at any point within the body of an action. For instance, consider the example below:<p class="paragraph"/><div class="code"><pre>def save() &#123;
    def book = Book(params)
    <span class="java&#45;keyword">if</span> (book.save()) &#123;
        // handle
    &#125;
    <span class="java&#45;keyword">else</span> &#123;
        render(view:<span class="java&#45;quote">"create"</span>, model:&#91;book:book&#93;)
    &#125;
&#125;</pre></div><p class="paragraph"/>In the above example the result of the model of the action is not available as the return value, but instead is stored within the <code>modelAndView</code> property of the controller. The <code>modelAndView</code> property is an instance of Spring MVC's <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/servlet/ModelAndView.html" target="blank">ModelAndView</a> class and you can use it to the test the result of an action:<p class="paragraph"/><div class="code"><pre>def bookController = <span class="java&#45;keyword">new</span> BookController()
bookController.save()
def model = bookController.modelAndView.model.book</pre></div><p class="paragraph"/><h4>Simulating Request Data</h4><p class="paragraph"/>You can use the Spring <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/mock/web/MockHttpServletRequest.html" class="api">MockHttpServletRequest</a> to test an action that requires request data, for example a REST web service. For example consider this action which performs data binding from an incoming request:<p class="paragraph"/><div class="code"><pre>def create() &#123;
    &#91;book: <span class="java&#45;keyword">new</span> Book(params.book)&#93;
&#125;</pre></div><p class="paragraph"/>To simulate the 'book' parameter as an XML request you could do something like the following:<p class="paragraph"/><div class="code"><pre>void testCreateWithXML() &#123;<p class="paragraph"/>    def controller = <span class="java&#45;keyword">new</span> BookController()<p class="paragraph"/>    controller.request.contentType = 'text/xml'
    controller.request.content = '''&#92;&#10;            &#60;?xml version=<span class="java&#45;quote">"1.0"</span> encoding=<span class="java&#45;quote">"ISO&#45;8859&#45;1"</span>?&#62;
            &#60;book&#62;
                &#60;title&#62;The Stand&#60;/title&#62;
                &#8230;
            &#60;/book&#62;
            '''.stripIndent().getBytes() // note we need the bytes<p class="paragraph"/>    def model = controller.create()
    assert model.book
    assertEquals <span class="java&#45;quote">"The Stand"</span>, model.book.title
&#125;</pre></div><p class="paragraph"/>The same can be achieved with a JSON request:<p class="paragraph"/><div class="code"><pre>void testCreateWithJSON() &#123;<p class="paragraph"/>    def controller = <span class="java&#45;keyword">new</span> BookController()<p class="paragraph"/>    controller.request.contentType = <span class="java&#45;quote">"text/json"</span>
    controller.request.content =
            '&#123;<span class="java&#45;quote">"id"</span>:1,<span class="java&#45;quote">"class"</span>:<span class="java&#45;quote">"Book"</span>,<span class="java&#45;quote">"title"</span>:<span class="java&#45;quote">"The Stand"</span>&#125;'.getBytes()<p class="paragraph"/>    def model = controller.create()
    assert model.book
    assertEquals <span class="java&#45;quote">"The Stand"</span>, model.book.title
&#125;</pre></div><p class="paragraph"/><blockquote class="note">
With JSON don't forget the <code>class</code> property to specify the name the target type to bind to. In XML this is implicit within the name of the <code>&#60;book&#62;</code> node, but this property is required as part of the JSON packet.
</blockquote><p class="paragraph"/>For more information on the subject of REST web services see the section on <a href="../guide/single.html#REST" class="guide">REST</a>.<p class="paragraph"/><h4>Testing Web Flows</h4><p class="paragraph"/>Testing <a href="../guide/single.html#webflow" class="guide">Web Flows</a> requires a special test harness called <code>grails.test.WebFlowTestCase</code> which subclasses Spring Web Flow's <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/webflow/test/execution/AbstractFlowExecutionTests.html" class="api">AbstractFlowExecutionTests</a> class.<p class="paragraph"/><blockquote class="note">
Subclasses of <code>WebFlowTestCase</code> <strong class="bold">must</strong> be integration tests
</blockquote><p class="paragraph"/>For example given this simple flow:<p class="paragraph"/><div class="code"><pre>class ExampleController &#123;<p class="paragraph"/>    def exampleFlow() &#123;
        start &#123;
            on(<span class="java&#45;quote">"go"</span>) &#123;
                flow.hello = <span class="java&#45;quote">"world"</span>
            &#125;.to <span class="java&#45;quote">"next"</span>
        &#125;
        next &#123;
            on(<span class="java&#45;quote">"back"</span>).to <span class="java&#45;quote">"start"</span>
            on(<span class="java&#45;quote">"go"</span>).to <span class="java&#45;quote">"subber"</span>
        &#125;
        subber &#123;
            subflow(action: <span class="java&#45;quote">"sub"</span>)
            on(<span class="java&#45;quote">"end"</span>).to(<span class="java&#45;quote">"end"</span>)
        &#125;
        end()
    &#125;<p class="paragraph"/>    def subFlow() &#123;
        subSubflowState &#123;
            subflow(controller: <span class="java&#45;quote">"other"</span>, action: <span class="java&#45;quote">"otherSub"</span>)
            on(<span class="java&#45;quote">"next"</span>).to(<span class="java&#45;quote">"next"</span>)
        &#125;
        &#8230;
    &#125;
&#125;</pre></div><p class="paragraph"/>You need to tell the test harness what to use for the "flow definition". This is done via overriding the abstract <code>getFlow</code>
 method:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">import</span> grails.test.WebFlowTestCase<p class="paragraph"/>class ExampleFlowTests <span class="java&#45;keyword">extends</span> WebFlowTestCase &#123;
    def getFlow() &#123; <span class="java&#45;keyword">new</span> ExampleController().exampleFlow &#125;
    &#8230;
&#125;</pre></div><p class="paragraph"/>You can specify the flow id by overriding the <code>getFlowId</code> method, otherwise the default is <code>test</code>:
<div class="code"><pre><span class="java&#45;keyword">import</span> grails.test.WebFlowTestCase<p class="paragraph"/>class ExampleFlowTests <span class="java&#45;keyword">extends</span> WebFlowTestCase &#123;
    <span class="java&#45;object">String</span> getFlowId() &#123; <span class="java&#45;quote">"example"</span> &#125;
    &#8230;
&#125;</pre></div><p class="paragraph"/>If the flow under test calls any subflows, these (or mocks) must be registered before the calling the flow:
<div class="code"><pre><span class="java&#45;keyword">protected</span> void setUp() &#123;
    <span class="java&#45;keyword">super</span>.setUp()<p class="paragraph"/>    registerFlow(<span class="java&#45;quote">"other/otherSub"</span>) &#123; // register a simplified mock
        start &#123;
            on(<span class="java&#45;quote">"next"</span>).to(<span class="java&#45;quote">"end"</span>)
        &#125;
        end()
    &#125;<p class="paragraph"/>    // register the original subflow
    registerFlow(<span class="java&#45;quote">"example/sub"</span>, <span class="java&#45;keyword">new</span> ExampleController().subFlow)
&#125;</pre></div><p class="paragraph"/>Then you kick off the flow with the <code>startFlow</code> method:<p class="paragraph"/><div class="code"><pre>void testExampleFlow() &#123;
    def viewSelection = startFlow()
    &#8230;
&#125;</pre></div><p class="paragraph"/>Use the <code>signalEvent</code> method to trigger an event:<p class="paragraph"/><div class="code"><pre>void testExampleFlow() &#123;
    &#8230;
    signalEvent(<span class="java&#45;quote">"go"</span>)
    assert <span class="java&#45;quote">"next"</span> == flowExecution.activeSession.state.id
    assert <span class="java&#45;quote">"world"</span> == flowScope.hello
&#125;</pre></div><p class="paragraph"/>Here we have signaled to the flow to execute the event "go" which causes a transition to the "next" state. In the example a transition action placed a <code>hello</code> variable into the flow scope.<p class="paragraph"/><h4>Testing Tag Libraries</h4><p class="paragraph"/>Testing tag libraries is simple because when a tag is invoked as a method it returns its result as a string (technically a <code>StreamCharBuffer</code> but this class implements all of the methods of <code>String</code>). So for example if you have a tag library like this:<p class="paragraph"/><div class="code"><pre>class FooTagLib &#123;<p class="paragraph"/>    def bar = &#123; attrs, body &#45;&#62;
        out &#60;&#60; <span class="java&#45;quote">"&#60;p&#62;Hello World!&#60;/p&#62;"</span>
    &#125;<p class="paragraph"/>    def bodyTag = &#123; attrs, body &#45;&#62;
        out &#60;&#60; <span class="java&#45;quote">"&#60;&#36;&#123;attrs.name&#125;&#62;"</span>
        out &#60;&#60; body()
        out &#60;&#60; <span class="java&#45;quote">"&#60;/&#36;&#123;attrs.name&#125;&#62;"</span>
    &#125;
&#125;</pre></div><p class="paragraph"/>The tests would look like:<p class="paragraph"/><div class="code"><pre>class FooTagLibTests <span class="java&#45;keyword">extends</span> GroovyTestCase &#123;<p class="paragraph"/>    void testBarTag() &#123;
        assertEquals <span class="java&#45;quote">"&#60;p&#62;Hello World!&#60;/p&#62;"</span>,
                     <span class="java&#45;keyword">new</span> FooTagLib().bar(<span class="java&#45;keyword">null</span>, <span class="java&#45;keyword">null</span>).toString()
    &#125;<p class="paragraph"/>    void testBodyTag() &#123;
        assertEquals <span class="java&#45;quote">"&#60;p&#62;Hello World!&#60;/p&#62;"</span>,
                     <span class="java&#45;keyword">new</span> FooTagLib().bodyTag(name: <span class="java&#45;quote">"p"</span>) &#123;
                         <span class="java&#45;quote">"Hello World!"</span>
                     &#125;.toString()
    &#125;
&#125;</pre></div><p class="paragraph"/>Notice that for the second example, <code>testBodyTag</code>, we pass a block that returns the body of the tag. This is convenient to representing the body as a String.<p class="paragraph"/><h4>Testing Tag Libraries with GroovyPagesTestCase</h4><p class="paragraph"/>In addition to doing simple testing of tag libraries like in the above examples, you can also use the <code>grails.test.GroovyPagesTestCase</code> class to test tag libraries with integration tests.<p class="paragraph"/>The <code>GroovyPagesTestCase</code> class is a subclass of the standard <code>GroovyTestCase</code> class and adds utility methods for testing the output of GSP rendering.<p class="paragraph"/><blockquote class="note">
<code>GroovyPagesTestCase</code> can only be used in an integration test.
</blockquote><p class="paragraph"/>For example, consider this date formatting tag library:<p class="paragraph"/><div class="code"><pre><span class="java&#45;keyword">import</span> java.text.SimpleDateFormat<p class="paragraph"/>class FormatTagLib &#123;
    def dateFormat = &#123; attrs, body &#45;&#62;
        out &#60;&#60; <span class="java&#45;keyword">new</span> SimpleDateFormat(attrs.format) &#60;&#60; attrs.date
    &#125;
&#125;</pre></div><p class="paragraph"/>This can be easily tested as follows:<p class="paragraph"/><div class="code"><pre>class FormatTagLibTests <span class="java&#45;keyword">extends</span> GroovyPagesTestCase &#123;
    void testDateFormat() &#123;
        def template =
                '&#60;g:dateFormat format=<span class="java&#45;quote">"dd&#45;MM&#45;yyyy"</span> date=<span class="java&#45;quote">"&#36;&#123;myDate&#125;"</span> /&#62;'<p class="paragraph"/>        def testDate = &#8230; // create the date
        assertOutputEquals('01&#45;01&#45;2008', template, &#91;myDate:testDate&#93;)
    &#125;
&#125;</pre></div><p class="paragraph"/>You can also obtain the result of a GSP using the <code>applyTemplate</code> method of the <code>GroovyPagesTestCase</code> class:<p class="paragraph"/><div class="code"><pre>class FormatTagLibTests <span class="java&#45;keyword">extends</span> GroovyPagesTestCase &#123;
    void testDateFormat() &#123;
        def template =
                '&#60;g:dateFormat format=<span class="java&#45;quote">"dd&#45;MM&#45;yyyy"</span> date=<span class="java&#45;quote">"&#36;&#123;myDate&#125;"</span> /&#62;'<p class="paragraph"/>        def testDate = &#8230; // create the date
        def result = applyTemplate(template, &#91;myDate:testDate&#93;)<p class="paragraph"/>        assertEquals '01&#45;01&#45;2008', result
    &#125;
&#125;</pre></div><p class="paragraph"/><h4>Testing Domain Classes</h4><p class="paragraph"/>Testing domain classes is typically a simple matter of using the <a href="../guide/single.html#GORM" class="guide">GORM API</a>, but there are a few things to be aware of. Firstly, when testing queries you often need to "flush" to ensure the correct state has been persisted to the database. For example take the following example:<p class="paragraph"/><div class="code"><pre>void testQuery() &#123;
    def books = &#91;
            <span class="java&#45;keyword">new</span> Book(title: <span class="java&#45;quote">"The Stand"</span>),
            <span class="java&#45;keyword">new</span> Book(title: <span class="java&#45;quote">"The Shining"</span>)&#93;
    books&#42;.save()<p class="paragraph"/>    assertEquals 2, Book.list().size()
&#125;</pre></div><p class="paragraph"/>This test will fail because calling <a href="../ref/Domain Classes/save.html" class="domainClasses">save</a> does not actually persist the <code>Book</code> instances when called. Calling <code>save</code> only indicates to Hibernate that at some point in the future these instances should be persisted. To commit changes immediately you "flush" them:<p class="paragraph"/><div class="code"><pre>void testQuery() &#123;
    def books = &#91;
            <span class="java&#45;keyword">new</span> Book(title: <span class="java&#45;quote">"The Stand"</span>),
            <span class="java&#45;keyword">new</span> Book(title: <span class="java&#45;quote">"The Shining"</span>)&#93;
    books&#42;.save(flush: <span class="java&#45;keyword">true</span>)<p class="paragraph"/>    assertEquals 2, Book.list().size()
&#125;</pre></div><p class="paragraph"/>In this case since we're passing the argument <code>flush</code> with a value of <code>true</code> the updates will be persisted immediately and hence will be available to the query later on.



                <div style="clear:both;margin-top:15px;"></div>
                
                    <div class="toc-item prev-left"><a href="../../guide/services.html">&lt;&lt; <strong>9</strong><span>The Service Layer</span></a></div>
                
                    <div class="toc-item next-right"><a href="../../guide/i18n.html"><strong>11</strong><span>Internationalization</span> >></a></div>
                
                <div style="clear:both"></div>
            </div>
        </td>
        <td id="col2">
            <div class="local clearfix">
                <div class="local-title">
                    <a href="../../guide/index.html" target="mainFrame">Quick Reference</a>
                    <span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
                </div>
                <div class="menu">
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Command Line</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Command%20Line/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/add-proxy.html">add-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/alias.html">alias</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/bootstrap.html">bootstrap</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/bug-report.html">bug-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/clean.html">clean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/clear-proxy.html">clear-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/compile.html">compile</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/console.html">console</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-app.html">create-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-controller.html">create-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-domain-class.html">create-domain-class</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-filters.html">create-filters</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-hibernate-cfg-xml.html">create-hibernate-cfg-xml</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-integration-test.html">create-integration-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-multi-project-build.html">create-multi-project-build</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-plugin.html">create-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-pom.html">create-pom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-scaffold-controller.html">create-scaffold-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-script.html">create-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-service.html">create-service</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-tag-lib.html">create-tag-lib</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/create-unit-test.html">create-unit-test</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/dependency-report.html">dependency-report</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/doc.html">doc</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/generate-all.html">generate-all</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/generate-controller.html">generate-controller</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/generate-views.html">generate-views</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/help.html">help</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/init.html">init</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/install-dependency.html">install-dependency</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/install-plugin.html">install-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/install-templates.html">install-templates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/integrate-with.html">integrate-with</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/interactive.html">interactive</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/list-plugin-updates.html">list-plugin-updates</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/list-plugins.html">list-plugins</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/migrate-docs.html">migrate-docs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/package-plugin.html">package-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/package.html">package</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/plugin-info.html">plugin-info</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/refresh-dependencies.html">refresh-dependencies</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/remove-proxy.html">remove-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/run-app.html">run-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/run-script.html">run-script</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/run-war.html">run-war</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/schema-export.html">schema-export</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/set-proxy.html">set-proxy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/set-version.html">set-version</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/shell.html">shell</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/stats.html">stats</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/stop-app.html">stop-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/test-app.html">test-app</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/uninstall-plugin.html">uninstall-plugin</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/upgrade.html">upgrade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/war.html">war</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Command%20Line/wrapper.html">wrapper</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Constraints</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Constraints/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Constraints/attributes.html">attributes</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/bindable.html">bindable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/blank.html">blank</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/creditCard.html">creditCard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/email.html">email</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/inList.html">inList</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/matches.html">matches</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/max.html">max</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/maxSize.html">maxSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/min.html">min</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/minSize.html">minSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/notEqual.html">notEqual</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/nullable.html">nullable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/range.html">range</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/scale.html">scale</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/size.html">size</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/unique.html">unique</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/url.html">url</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/validator.html">validator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Constraints/widget.html">widget</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Controllers</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Controllers/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Controllers/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/afterInterceptor.html">afterInterceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/allowedMethods.html">allowedMethods</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/beforeInterceptor.html">beforeInterceptor</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/bindData.html">bindData</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/chain.html">chain</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/defaultAction.html">defaultAction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/forward.html">forward</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/grailsApplication.html">grailsApplication</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/redirect.html">redirect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/session.html">session</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/withForm.html">withForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Controllers/withFormat.html">withFormat</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Database Mapping</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/autoImport.html">autoImport</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/autoTimestamp.html">autoTimestamp</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/batchSize.html">batchSize</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/cache.html">cache</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/cascade.html">cascade</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/column.html">column</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/comment.html">comment</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/discriminator.html">discriminator</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/dynamicInsert.html">dynamicInsert</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/dynamicUpdate.html">dynamicUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/fetch.html">fetch</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/id.html">id</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/ignoreNotFound.html">ignoreNotFound</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/indexColumn.html">indexColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/insertable.html">insertable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/joinTable.html">joinTable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/lazy.html">lazy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/order.html">order</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/sort.html">sort</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/table.html">table</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/type.html">type</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/updateable.html">updateable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Database%20Mapping/version.html">version</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Domain Classes</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/addTo.html">addTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/attach.html">attach</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/belongsTo.html">belongsTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/clearErrors.html">clearErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/constraints.html">constraints</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/count.html">count</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/countBy.html">countBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/createCriteria.html">createCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/delete.html">delete</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/discard.html">discard</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/embedded.html">embedded</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/errors.html">errors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/executeQuery.html">executeQuery</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/executeUpdate.html">executeUpdate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/exists.html">exists</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/fetchMode.html">fetchMode</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/find.html">find</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findAllBy.html">findAllBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findAllWhere.html">findAllWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findBy.html">findBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrCreateBy.html">findOrCreateBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrCreateWhere.html">findOrCreateWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrSaveBy.html">findOrSaveBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findOrSaveWhere.html">findOrSaveWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/findWhere.html">findWhere</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/first.html">first</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/get.html">get</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/getAll.html">getAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/getDirtyPropertyNames.html">getDirtyPropertyNames</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/getPersistentValue.html">getPersistentValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/hasMany.html">hasMany</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/hasOne.html">hasOne</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/ident.html">ident</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/instanceOf.html">instanceOf</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/isAttached.html">isAttached</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/isDirty.html">isDirty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/last.html">last</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/list.html">list</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/listOrderBy.html">listOrderBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/load.html">load</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/lock.html">lock</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/mappedBy.html">mappedBy</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/mapping.html">mapping</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/merge.html">merge</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/namedQueries.html">namedQueries</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/properties.html">properties</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/read.html">read</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/refresh.html">refresh</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/removeFrom.html">removeFrom</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/save.html">save</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/transients.html">transients</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/validate.html">validate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/where.html">where</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/whereAny.html">whereAny</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withCriteria.html">withCriteria</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withNewSession.html">withNewSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withSession.html">withSession</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Domain%20Classes/withTransaction.html">withTransaction</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Plug-ins</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Plug-ins/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/URL%20mappings.html">URL mappings</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/codecs.html">codecs</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/controllers.html">controllers</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/core.html">core</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/dataSource.html">dataSource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/domainClasses.html">domainClasses</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/filters.html">filters</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/hibernate.html">hibernate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/i18n.html">i18n</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/logging.html">logging</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/scaffolding.html">scaffolding</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/services.html">services</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/servlets.html">servlets</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Plug-ins/web%20flow.html">web flow</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Services</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Services/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Services/scope.html">scope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Services/transactional.html">transactional</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Servlet API</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Servlet%20API/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tag Libraries</h1><div class="menu-sub">
                        
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/Usage.html">Usage</a></div>
                            
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/actionName.html">actionName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/controllerName.html">controllerName</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/flash.html">flash</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/pageScope.html">pageScope</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/params.html">params</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/request.html">request</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/response.html">response</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/servletContext.html">servletContext</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tag%20Libraries/session.html">session</a>
                            </div>
                            
                            </div>
                    </div>
                    
                    <div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">Tags</h1><div class="menu-sub">
                        
                            
                            <div class="menu-item"><a href="../../ref/Tags/actionSubmit.html">actionSubmit</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/actionSubmitImage.html">actionSubmitImage</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/applyLayout.html">applyLayout</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/checkBox.html">checkBox</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/collect.html">collect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/cookie.html">cookie</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/country.html">country</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/countrySelect.html">countrySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/createLink.html">createLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/createLinkTo.html">createLinkTo</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/currencySelect.html">currencySelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/datePicker.html">datePicker</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/each.html">each</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/eachError.html">eachError</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/else.html">else</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/elseif.html">elseif</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/external.html">external</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/field.html">field</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/fieldValue.html">fieldValue</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/findAll.html">findAll</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/form.html">form</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formRemote.html">formRemote</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formatBoolean.html">formatBoolean</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formatDate.html">formatDate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/formatNumber.html">formatNumber</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/grep.html">grep</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/hasErrors.html">hasErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/header.html">header</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/hiddenField.html">hiddenField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/if.html">if</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/img.html">img</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/include.html">include</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/isAvailable.html">isAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/isNotAvailable.html">isNotAvailable</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/javascript.html">javascript</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/join.html">join</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/layoutBody.html">layoutBody</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/layoutHead.html">layoutHead</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/layoutTitle.html">layoutTitle</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/link.html">link</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/localeSelect.html">localeSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/message.html">message</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/meta.html">meta</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/pageProperty.html">pageProperty</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/paginate.html">paginate</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/passwordField.html">passwordField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/radio.html">radio</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/radioGroup.html">radioGroup</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/remoteField.html">remoteField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/remoteFunction.html">remoteFunction</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/remoteLink.html">remoteLink</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/render.html">render</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/renderErrors.html">renderErrors</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/resource.html">resource</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/select.html">select</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/set.html">set</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/setProvider.html">setProvider</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/sortableColumn.html">sortableColumn</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/submitButton.html">submitButton</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/submitToRemote.html">submitToRemote</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/textArea.html">textArea</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/textField.html">textField</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/timeZoneSelect.html">timeZoneSelect</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/unless.html">unless</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/uploadForm.html">uploadForm</a>
                            </div>
                            
                            <div class="menu-item"><a href="../../ref/Tags/while.html">while</a>
                            </div>
                            
                            </div>
                    </div>
                    
                </div>
            </div>
        </td>
    </tr>
</table>

<div id="footer">
    Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
    Sponsored by <a href="http://springsource.com">SpringSource</a>
</div>

<script type="text/javascript" src="../js/docs.js"></script>

</body>
</html>
